﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using JKF.DataModule.SqlServerDAL;
using JKF.Entities.Model;

namespace JKF.BusinessLayer.BLL
{
    public partial class bllSALES_CONSUME
    {
        /// <summary>
        /// 查询配件维修记录
        /// </summary>
        /// <param name="regStart"></param>
        /// <param name="regEnd"></param>
        /// <param name="status"></param>
        /// <param name="ownShops"></param>
        /// <param name="filter"></param>
        /// <param name="filterOp"></param>
        /// <param name="filterKey"></param>
        /// <param name="currentUser"></param>
        /// <param name="pageCurrent"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageCount"></param>
        /// <param name="rowCount"></param>
        /// <returns></returns>
        public static DataTable GetSalesContractPaging(string regStart, string regEnd, string status, string ownShops,
                                                      string filter, string filterOp, string filterKey, string currentUser, int pageCurrent,
                                                      int pageSize, ref int pageCount, ref int rowCount)
        {
            return dalSALES_CONSUME.GetSalesConsumePaging(regStart, regEnd, status, ownShops, filter, filterOp, filterKey, currentUser, pageCurrent, pageSize,
                                                            ref pageCount, ref rowCount);
        }

        /// <summary>
        /// 返回当前客户购买记录
        /// </summary>
        /// <param name="customerKey"></param>
        /// <param name="currentUser"></param>
        /// <returns></returns>
        public static DataTable GetCustomerSalesConsume(string customerKey, string currentUser)
        {
            return dalSALES_CONSUME.GetCustomerSalesConsume(customerKey, currentUser);
        }

        /// <summary>
        /// 通过客户编号返回顾客信息
        /// </summary>
        /// <param name="customerKey"></param>
        /// <param name="userCurrent"></param>
        /// <param name="pageCurrent"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageCount"></param>
        /// <param name="rowCount"></param>
        /// <returns></returns>
        public static DataTable GetSalesConsumeForCustomerPaging(string customerKey, string userCurrent, int
                                                                              pageCurrent, int pageSize, ref int pageCount,
                                                                              ref int rowCount)
        {
            return dalSALES_CONSUME.GetSalesConsumeForCustomerPaging(customerKey, userCurrent, pageCurrent, pageSize,
                                                            ref pageCount, ref rowCount);
        }
        /// <summary>
        /// 删除配件维修记录
        /// </summary>
        /// <param name="consumeKey"></param>
        /// <returns></returns>
        public static int RemoveSalesConsume(string consumeKey)
        {
            return dalSALES_CONSUME.RemoveSalesConsume(consumeKey);
        }

        /// <summary>
        /// 添加配件维修记录
        /// </summary>
        /// <param name="consume"></param>
        /// <param name="pointlog"></param>
        /// <param name="stockOut"></param>
        /// <returns></returns>
        public static bool InsertSalesComsume(SALES_CONSUMEinfo consume, POINT_LOGinfo pointlog, STOCK_OUTinfo stockOut)
        {
            return dalSALES_CONSUME.InsertSalesComsume(consume, pointlog, stockOut);
        }

        /// <summary>
        /// 配件维修记录唯一编号
        /// </summary>
        /// <param name="shopCode"></param>
        /// <returns></returns>
        public static string GetSalesConsumeUniqueCode(string shopCode)
        {
            return dalSALES_CONSUME.GetSalesConsumeUniqueCode(shopCode);
        }

        /// <summary>
        /// 更新配件维修记录
        /// </summary>
        /// <param name="consume"></param>
        /// <returns></returns>
        public static bool UpdateSalesConsume(SALES_CONSUMEinfo consume)
        {
            return dalSALES_CONSUME.UpdateSalesConsume(consume);
        }

    }
}
